package com.xbdun.facade.bmp.enumx;

public class SysMenuEnum {
	/**
	* @ClassName: SysMenuEnableEnum
	* @Description: 平台菜单是否启用
	* @author zhanggt 360730440@qq.com
	* @date 2017年3月21日 下午5:58:59
	*/
	public enum SysMenuEnableEnum{
		ON(1,"启用"),OFF(2,"未启用");
		private int key;
		private String val;
		SysMenuEnableEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		
		public static SysMenuEnableEnum getEnum(int key){
			SysMenuEnableEnum resultEnum=null;
			SysMenuEnableEnum[] enumAry=SysMenuEnableEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
		public static boolean isKey(int key){
			if (null != SysMenuEnableEnum.getEnum(key)) return true;
			return false;
		}
	}
	
	/**
	* @ClassName: SysMenuBldelEnum
	* @Description: 菜单删除状态
	* @author zhanggt 360730440@qq.com
	* @date 2017年3月21日 下午6:04:40
	 */
	public enum SysMenuBldelEnum{
		DELETE_YES(1,"已删除"),DELETE_NO(2,"未删除");
		private int key;
		private String val;
		SysMenuBldelEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static SysMenuBldelEnum getEnum(int key){
			SysMenuBldelEnum resultEnum=null;
			SysMenuBldelEnum[] enumAry=SysMenuBldelEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
		public static boolean isKey(int key){
			if (null != SysMenuBldelEnum .getEnum(key)) return true;
			return false;
		}
	}
	/**
	 * @ClassName: SysMenuTargetEnum
	 * @Description: 菜单打开方式
	 * @author zhanggt 360730440@qq.com
	 * @date 2017年3月21日 下午6:04:40
	 */
	public enum SysMenuTargetEnum{
		_BLANK("_blank"), _SELF("_self"), _PARRENT("_parent"),_TOP("_top"),_IFRAME("iframe");
		private String val;
		SysMenuTargetEnum(String val){
			this.val = val;
		}
		public String getVal() {
			return val;
		}
		
		public static boolean isValue(String target){
			boolean falg = false;
			for (SysMenuTargetEnum e : SysMenuTargetEnum.values()) {
				if (target.equalsIgnoreCase(e.getVal())) {
					falg = true;
					break;
				}	
			}
			return falg;
		}
	}
	/**
	* @ClassName: SysMenuTypeEnum
	* @Description: 菜单类型
	* @author wwq
	* @date 2017年5月12日13:48:07
	 */
	public enum SysMenuTypeEnum{
		CATALOG(1,"目录"),PAGE(2,"页面"),BUTTON(3,"按钮");
		private int key;
		private String val;
		SysMenuTypeEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static SysMenuTypeEnum getEnum(int key){
			SysMenuTypeEnum resultEnum=null;
			SysMenuTypeEnum[] enumAry=SysMenuTypeEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
	}
	/**
	 * @ClassName: SysMenuDisplayEnum
	 * @Description: 菜单显示方式
	 * @author wwq
	 * @date 2017年5月13日13:52:39
	 */
	public enum SysMenuDisplayEnum{
		PLAY(1,"显示"),DISPLAY(2,"不显示");
		private int key;
		private String val;
		SysMenuDisplayEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static SysMenuDisplayEnum getEnum(int key){
			SysMenuDisplayEnum resultEnum=null;
			SysMenuDisplayEnum[] enumAry=SysMenuDisplayEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
	}
}
